<template>
  <div class='container'>
    <el-dialog title="预览文章" :visible="dialogVisible" width="50%" @close="close">
      <h2>{{ previewArtList.title }}</h2>
      <div>
        <span>{{ previewArtList.createTime | dateFormat }}</span>
        <span>{{ previewArtList.creatorID === 2? '超级管理员' : previewArtList.creatorID }}</span>
        <span class="el-icon-view"></span>
        <span>{{ previewArtList.visits }}</span>
      </div>
      <div class="content" v-html="previewArtList.articleBody"></div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    dialogVisible: {
      type: Boolean,
      dafault: false
    },
    previewArtList: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    close () {
      this.$emit('update:dialogVisible')
    }
  }
}
</script>

<style scoped lang='sass'>
.content
  padding: 10px
  background-color: #eee
  margin-top: 15px
  border-top: 1px dashed #ccc
span
  margin-left: 8px
</style>
